﻿#region Using Directives

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Xml.Linq;

    using Csla;

    using MarketPulse.BusinessLogic.Core;

#endregion

namespace MarketPulse.BusinessLogic.Common
{
    /// <summary>
    /// Class used as guid based enumeration list that holds the possible types for Visit Events
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.BusinessLogic.DataAccess.LinqSProcVisitEventTypeFactory, DataAccess")]
    public class VisitEventTypeList : MarketPulseNameValueListBase<Guid, string>
    {
        #region Member Variables

            /// <summary>
            /// List to hold all the possible VisitEventTypes
            /// </summary>
            private static VisitEventTypeList mVisitEventTypes;

        #endregion

        #region Constructors

            /// <summary>
            /// default constructor is private in order to (try to) enforce construction
            /// via only the static factory methods provided.
            /// </summary>
            private VisitEventTypeList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method used to get a list of name/value pairs representing VisitEventTypes 
                /// from the database.  Internally this accesses a static field so this
                /// class is effectively a lazily instantiated singleton.
                /// </summary>
                public static void GetList(EventHandler<DataPortalResult<VisitEventTypeList>> callback)
                {

                    if (mVisitEventTypes == null)
                    {
                        DataPortal.BeginFetch<VisitEventTypeList>((o, e) =>
                            {
                                mVisitEventTypes = e.Object;
                                callback(o, e);
                            });
                    }
                    else
                    {
                        callback(null, new DataPortalResult<VisitEventTypeList>(mVisitEventTypes, null, null));
                    }
                }

                /// <summary>
                /// Method used to get a list of name/value pairs representing VisitEventTypes 
                /// from the database.  Internally this accesses a static field so this
                /// class is effectively a lazily instantiated singleton.
                /// </summary>
                public static void GetList()
                {
                    // Load the list if it's null
                    if (mVisitEventTypes == null)
                    {
                        mVisitEventTypes = DataPortal.Fetch<VisitEventTypeList>();
                    }
                }               

            #endregion           

        #endregion

        #region Properties

            /// <summary>The Guid for the 'Create' Event</summary>
            public static Guid Create { get { return new Guid("3F3C7541-D89A-4B9E-B268-788B7C918D1F"); } }

            /// <summary>The Guid for the 'Release' Event</summary>
            public static Guid Release { get { return new Guid("2527BA2C-9934-4371-8912-08C6B095F177"); } }

            /// <summary>The Guid for the 'Assign' Event</summary>
            public static Guid Assign { get { return new Guid("B36FC8EF-DFC0-423D-9D88-567D623B2688"); } }

            /// <summary>The Guid for the 'UnassignWithPay' Event</summary>
            public static Guid UnassignWithPay { get { return new Guid("0FA7DEEA-6FC0-4FBC-AE2D-E781489D8397"); } }

            /// <summary>The Guid for the 'UnassignWithoutPay' Event</summary>
            public static Guid UnassignWithoutPay { get { return new Guid("AD6839B9-3BE0-4C04-A4BF-B289400770E8"); } }

            /// <summary>The Guid for the 'StartDataEntry' Event</summary>
            public static Guid StartDataEntry { get { return new Guid("5620ED12-B13E-40F8-9A9E-D41F91026EF7"); } }

            /// <summary>The Guid for the 'CompleteDataEntry' Event</summary>
            public static Guid CompleteDataEntry { get { return new Guid("90C0CBA7-A618-4BD7-A825-EAEDA974CB17"); } }

            /// <summary>The Guid for the 'Transfer' Event</summary>
            public static Guid Transfer { get { return new Guid("9ED9BF5C-5643-48B7-9DE5-6973709AEF0C"); } }

            /// <summary>The Guid for the 'Revisit' Event</summary>
            public static Guid Revisit { get { return new Guid("C381B0BD-23D7-4351-AC64-939C39A10198"); } }

        
        #endregion

    }
}
